/*
 * 文章搜索
 * @Author: LuoQianJun
 * @Date: 2018-01-30 09:31:16 
 * @Last Modified by: ljb
 * @Last Modified time: 2018-01-31 18:23:10
 */
<template>
<Form ref="formInline" inline>
    
    <Form-item label="文章类型" :label-width="100">
        <Select v-model="formValidate.article_type_id" clearable  filterable>
            <OptionGroup v-for="articleType in articleTypes" :key="articleType.id" :label="articleType.name">
                <Option v-for="sub_type in articleType.get_sub_tags" :value="sub_type.id + ''" :key="sub_type.id">{{ sub_type.name }}</Option>
            </OptionGroup>
        </Select>
    </Form-item>

    <Form-item label="文章标题" :label-width="100">
        <Input type="text"  placeholder="请输入文章标题" v-model="formValidate.title">
        </Input>
    </Form-item>

    <Form-item>
        <Button type="primary" @click="confirmSearch">搜索</Button>
    </Form-item>

</Form>
</template>
<script>

export default {

    props : ['articleTypes'],

    data: function () {

        return {

            formValidate : {

                article_type_id : '',  //文章类型id

                title : '', //文章名称

            },                  //搜索框的对象参数

        }
    },

    methods: {


         /**
         * 确认搜索
         * @return {undefined}
         */
        confirmSearch() {

            const param = {

                article_type_id : this.formValidate.article_type_id,

                title : this.formValidate.title,

            }

            this.$emit('search',param);

        }
        
    }
    
}

</script>